import { MockHttp } from "@/http/axios";

enum Auth {
  MOCK_USER_LOGIN = "/mock/api/login",
  MOCK_USER_INFO = "/mock/api/userInfo",
  MOCK_MENU_LIST = "/mock/api/menuList",
  MOCK_GET_ROUTES = "/mock/api/getRoutes",
  USER_LOGIN = "/login", // 用户登录
}

/** 登录 */
export const login = (params) =>
  MockHttp.post<App.RequestResult>({ url: Auth.MOCK_USER_LOGIN, params });

/** 用户信息 */
export const getUserInfo = () =>
  MockHttp.get<App.RequestResult>({ url: Auth.MOCK_USER_INFO });

/** 获取tree菜单列表 */
export const getMenuList = (params) =>
  MockHttp.get<App.RequestResult>({ url: Auth.MOCK_MENU_LIST, params });

/** 获取路由信息 */
export const getRoutes = () =>
  MockHttp.get<App.RequestResult>({ url: Auth.MOCK_GET_ROUTES });

/** 登录 */
// export const login = (params) =>
//    Http.post<App.RequestResult>({ url: Auth.USER_LOGIN, params });
